package com.sunwayworld.basemodule.samplemanage.sample.dao.impl;

import com.sunwayworld.framework.mybatis.mapper.MapperParameter;
import com.sunwayworld.framework.utils.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.sunwayworld.basemodule.samplemanage.sample.bean.LimsSampleBean;
import com.sunwayworld.basemodule.samplemanage.sample.dao.LimsSampleDao;
import com.sunwayworld.basemodule.samplemanage.sample.mapper.LimsSampleMapper;
import com.sunwayworld.framework.mybatis.dao.MybatisDaoSupport;
import com.sunwayworld.framework.spring.annotation.GikamBean;

import java.util.List;
import java.util.Map;

@Repository
@GikamBean
public class LimsSampleDaoImpl extends MybatisDaoSupport<LimsSampleBean, Long> implements LimsSampleDao {

    @Autowired
    private LimsSampleMapper limsSampleMapper;

    @Override
    public LimsSampleMapper getMapper() {
        return limsSampleMapper;
    }

    @Override
    public List<Map<String, Object>> selectHandleSample(MapperParameter param) {
        return getMapper().selectHandleSample(param);
    }

    @Override
    public Map<String, Object> selectDetail(Long id) {
        MapperParameter parameter = new MapperParameter();
        parameter.put("id", id);
        List<Map<String, Object>> mapList = getMapper().selectDetail(parameter);
        return mapList.isEmpty() ? CollectionUtils.emptyMap() : mapList.get(0);
    }

    @Override
    public List<Map<String, Object>> selectExpiredSamples(MapperParameter parameter) {
        return getMapper().selectExpiredSamples(parameter);
    }

    @Override
    public List<Map<String, Object>> selectForFormula(MapperParameter parameter) {
        return getMapper().selectForFormula(parameter);
    }

    @Override
    public List<Map<String, Object>> selectByParams(MapperParameter extractMapFilter) {
        return getMapper().selectByParams(extractMapFilter);
    }

    @Override
    public List<Map<String, Object>> selectSampleHandlesPagination(MapperParameter extractMapFilter) {
        return getMapper().selectSampleHandlesPagination(extractMapFilter);
    }

    @Override
    public List<Map<String, Object>> selectBatchCountStatics(String year, String loginOrgId) {
        return getMapper().selectBatchCountStatics(year, loginOrgId);
    }

    @Override
    public List<Map<String, Object>> selectSampleCountStatics(String year, String loginOrgId) {
        return getMapper().selectSampleCountStatics(year, loginOrgId);
    }

    @Override
    public List<Map<String, Object>> selectBatchSample(MapperParameter parameter) {
        return getMapper().selectBatchSample(parameter);
    }

    @Override
    public List<Map<String, Object>> selectSampleChildren(MapperParameter parameter) {
        return getMapper().selectSampleChildren(parameter);
    }

    @Override
    public List<Map<String, Object>> selectTestMethodBySampleCode(MapperParameter extractMapFilter) {
        return getMapper().selectTestMethodBySampleCode(extractMapFilter);
    }

    @Override
    public List<Map<String, Object>> selectBatchChooseSample(MapperParameter parameter) {
        return getMapper().selectBatchChooseSample(parameter);
    }

    @Override
    public List<Map<String, Object>> selectPassRate(MapperParameter parameter) {
        return getMapper().selectPassRate(parameter);
    }
}
